load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_binary", "mongo_cc_library")

package(default_visibility = ["//visibility:public"])

exports_files(
    glob([
        "*.h",
        "*.cpp",
    ]),
)

idl_generator(
    name = "mongobridge_options_gen",
    src = "mongobridge_options.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

mongo_cc_binary(
    name = "mongobridge",
    srcs = [
        "bridge.cpp",
        "bridge_commands.cpp",
        "mongobridge_options.cpp",
        "mongobridge_options_gen",
        "mongobridge_options_init.cpp",
    ],
    tags = [
        "dist_test",
    ],
    deps = [
        "//src/mongo/db:dbmessage",
        "//src/mongo/db/shard_role:service_context_non_d",
        # UBSAN builds needs the RTTI info for WhereMatchExpression, that is defined in this project.
        "//src/mongo/db/matcher:expressions_mongod_only",
        "//src/mongo/rpc",
        "//src/mongo/transport:message_compressor",
        "//src/mongo/transport:message_compressor_options_server",
        "//src/mongo/transport:service_executor",
        "//src/mongo/transport:session_manager",
        "//src/mongo/transport:transport_layer_manager",
        "//src/mongo/util:signal_handlers",
        "//src/mongo/util/net:network",
        "//src/mongo/util/options_parser:options_parser_init",
    ],
)
